<ol class="breadcrumb">
    <li> <i class="fa fa-anchor"></i>
        &nbsp;用户设置
    </li>
    <li>修改密码</li>
</ol>

<div class="col-xs-12 info-center" >
    <div class="bs-callout bs-callout-warning">
        <h4>
            系统使用单位: <strong>{:C('MANUFACTURER')}</strong>
        </h4>
    </div>
</div>

<div class="col-xs-12 info-center">
<div class="panel panel-mcit">
    <div class="panel-heading">
        <i class="fa fa-list"></i>
        &nbsp;&nbsp;密码修改 &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
    </div>
    <div class="panel-body">
        <div class="alert alert-warning">
            <p><i class="fa fa-paperclip"></i>&nbsp;修改账号登录密码</p>
        </div>
        <form class="mcit-dataform" id="data_form" method="post" action={:U("Set/changePwd")}>
        <div class="panel-footer">    
            <div class="panel-mcit">

                <div class="col-xs-6">
                    <div class="input-group">
                        <span class="input-group-addon">账号</span>
                        <input type="text"   class="form-control" value="{$user.fac_login_name}" readonly>
                    </div>
                </div>
                <div class="clearfix" ></div>

                <div class="col-xs-6">
                    <div class="input-group">
                        <span class="input-group-addon">原密码</span>
                        <input type="password" id="phone"  name="old_password" class="form-control" placeholder="原密码">
                    </div>
                </div>
                <div class="clearfix" ></div>

                <div class="col-xs-6">
                    <div class="input-group">
                        <span class="input-group-addon">新密码</span>
                        <input type="password" id="password" name="fac_password" class="form-control" placeholder="新密码">
                    </div>
                </div>
                <div class="clearfix" ></div>

                <div class="col-xs-6">
                    <div class="input-group">
                        <span class="input-group-addon">重复密码</span>
                        <input type="password" id="password1" name="fac_password1" class="form-control" placeholder="重复密码">
                    </div>
                </div>
                <div class="clearfix" ></div>


                <div class="col-xs-6">
                    <button type="submit" class="btn btn-warning"><i class="fa fa-upload"></i>&nbsp;确定修改</button>
                    <a href="javascript:history.go(-1);" class="btn btn-warning"><i class="fa fa-mail-reply"></i>&nbsp;返回</a>
                </div>
                <div class="clearfix"></div>

            </div>
        </div>
        </form>
    </div>
</div>
</div>

<script>
    $("#data_form").ajaxForm({
        dataType:'json',
        clearForm:true,
        beforeSubmit:function(){
            if($("#phone").val()==''){
                alertify.error("请填写原密码");
                return false;
            }
            if($("#password").val()==''){
                alertify.error("请填写新密码");
                return false;
            }
            if($("#password1").val()==''){
                alertify.error("请再次输入新密码");
                return false;
            }
            return true
        },
        success:function(data){
            if(data.state==100){
                alertify.success(data.msg);
                location.href = data.url;
            }else{
                alertify.error(data.msg);
            }
        }
    });
</script>